﻿@namespace AbpAntDesignBlazorServer.Themes.Basic
@inherits AntDomComponentBase
@using Volo.Abp.UI.Navigation;

<AntDesign.Dropdown Style="display: inherit; width: inherit;"
                    OverlayClassName="container">
    <Overlay>
        <Menu Class="menu" OnMenuItemClicked="OnItemSelected">
            @foreach (ApplicationMenuItem item in UserMenu.Items)
            {
                <MenuItem Key="account">
                    <a rel="noopener noreferrer" href="@item.Url">
                        <AntDesign.Icon Type="user" Theme="outline" />
                        @item.DisplayName
                    </a>
                </MenuItem>
            }
            <!--todo: missing component: menu-divider-->
            <li Class="ant-dropdown-menu-item-divider"></li>
            <MenuItem Key="logout">
                <AntDesign.Icon Type="logout" Theme="outline" />
                @L["Logout"]
            </MenuItem>
        </Menu>
    </Overlay>
    <ChildContent>
        <span class="action account">
            @if (Avatar == string.Empty)
            {
                <Avatar Size="small" Class="avatar" Icon="user" Alt="avatar" /> }
            else
            {
                <Avatar Size="small" Class="avatar" Src="@Avatar" Alt="avatar" />}
            <span class="name anticon">@Name</span>
        </span>
    </ChildContent>
</AntDesign.Dropdown>
